#pragma once

// This library must be included
#pragma comment(lib, "winmm.lib")

#include <windows.h>

#define Clock CrudeTimer::Instance()

class CrudeTimer
{
private:
  
  // Set to the time (in seconds) when class is instantiated
  double m_dStartTime;

  // Set the start time
  CrudeTimer(){m_dStartTime = timeGetTime() * 0.001;}

  // Copy ctor and assignment should be private
  CrudeTimer(const CrudeTimer&);
  CrudeTimer& operator=(const CrudeTimer&);
  
public:

  static CrudeTimer* Instance();

  // Returns how much time has elapsed since the timer was started
  double GetCurrentTime(){return timeGetTime() * 0.001 - m_dStartTime;}

};